package com.bit.ioc.component;

import com.bit.ioc.model.Student;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Component
public class StudentComponent {
//    @Primary
    @Bean({"s3", "s4"})
//    @Bean(name = {"s3", "s4"})
//    @Bean(value = {"s3", "s4"})
    public Student s1(){
        return new Student("zhangsan", 11);
    }


    @Bean
    public String name(){
        return "lisi";
    }

    @Bean
    public String name2(){
        return "lisi2";
    }

    @Bean
    public Student s2(@Qualifier("name") String n){
        return new Student(n, 18);
    }
}
